package com.shanghaionstar.navi.search.viewholder;

import android.view.View;
import android.widget.TextView;

import com.amap.api.services.help.Tip;
import com.shanghaionstar.R;
import com.shanghaionstar.navi.base.BaseViewHolder;
import com.shanghaionstar.navi.listener.OnItemClickListener;


public class NavSearchResultVH extends BaseViewHolder {

    public TextView itemName;
    public TextView itemSendToCar;

    public NavSearchResultVH(View itemView) {
        super(itemView);

        itemName = findViewById(R.id.history_item_name);
        itemSendToCar = findViewById(R.id.history_item_send_to_car);
    }

    public void setOnItemClickListener(final Tip tipItem, final OnItemClickListener<Tip> listener) {
        this.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                clickItemView(tipItem, listener);
            }
        });
    }

    protected void clickItemView(Tip tipItem, OnItemClickListener<Tip> listener) {
        if (listener != null)
            listener.onItemClick(tipItem);
    }
}
